﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="OrderScheduler.ascx.cs" Inherits="UserControls_OrderScheduler" %>
<%@ Register assembly="DevExpress.XtraScheduler.v12.1.Core, Version=12.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.XtraScheduler" tagprefix="cc1" %>
<%@ Register assembly="DevExpress.Web.ASPxScheduler.v12.1, Version=12.1.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxScheduler" tagprefix="dxwschs" %>
<dxwschs:ASPxScheduler ID="myScheduler" runat="server" 
    AppointmentDataSourceID="appointmentSqlDataSource" ClientIDMode="AutoID" 
    ResourceDataSourceID="resourceSqlDataSource" Start="2012-07-26">
    <Storage>
        <Appointments>
            <Mappings AppointmentId="OrderID" Description="Description" End="EndDate" 
                Location="Location" ResourceId="ProductID" Start="StartDate" 
                Subject="Subject" />
        </Appointments>
        <Resources>
            <Mappings Caption="Model" ResourceId="ProductID" />
        </Resources>
    </Storage>
<Views>
<DayView><TimeRulers>
<cc1:TimeRuler></cc1:TimeRuler>
</TimeRulers>
</DayView>

<WorkWeekView><TimeRulers>
<cc1:TimeRuler></cc1:TimeRuler>
</TimeRulers>
</WorkWeekView>
</Views>

<ClientSideEvents MouseUp=""></ClientSideEvents>
    <OptionsCustomization AllowAppointmentCreate="None" 
        AllowAppointmentDrag="NonRecurring" AllowDisplayAppointmentForm="Always" />
    <OptionsMenu EnableMenuScrolling="True" />
</dxwschs:ASPxScheduler>

<asp:SqlDataSource ID="appointmentSqlDataSource" runat="server" 
    ConnectionString="<%$ ConnectionStrings:CocShopDatabaseConnectionString %>" 
    DeleteCommand="DELETE FROM [OrderScheduling] WHERE [OrderID] = @OrderID" 
    InsertCommand="INSERT INTO [OrderScheduling] ([ProductID], [SupplierID], [Subject], [Description], [Location], [Quantity], [StartDate], [EndDate]) VALUES (@ProductID, @SupplierID, @Subject, @Description, @Location, @Quantity, @StartDate, @EndDate)" 
    SelectCommand="SELECT * FROM [OrderScheduling]" 
    UpdateCommand="UPDATE [OrderScheduling] SET [ProductID] = @ProductID, [Subject] = @Subject, [Description] = @Description, [Location] = @Location, [Quantity] = @Quantity, [StartDate] = @StartDate, [EndDate] = @EndDate WHERE [OrderID] = @OrderID">
    <DeleteParameters>
        <asp:Parameter Name="OrderID" Type="Int32" />
    </DeleteParameters>
    <InsertParameters>
        <asp:Parameter Name="ProductID" Type="Int32" />
        <asp:Parameter Name="SupplierID" Type="Int32" />
        <asp:Parameter Name="Subject" Type="String" />
        <asp:Parameter Name="Description" Type="String" />
        <asp:Parameter Name="Location" Type="String" />
        <asp:Parameter Name="Quantity" Type="Int32" />
        <asp:Parameter DbType="Date" Name="StartDate" />
        <asp:Parameter DbType="Date" Name="EndDate" />
    </InsertParameters>
    <UpdateParameters>
        <asp:Parameter Name="ProductID" Type="Int32" />
        <asp:Parameter Name="Subject" Type="String" />
        <asp:Parameter Name="Description" Type="String" />
        <asp:Parameter Name="Location" Type="String" />
        <asp:Parameter Name="Quantity" Type="Int32" />
        <asp:Parameter DbType="Date" Name="StartDate" />
        <asp:Parameter DbType="Date" Name="EndDate" />
        <asp:Parameter Name="OrderID" Type="Int32" />
    </UpdateParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="resourceSqlDataSource" runat="server" 
    ConnectionString="<%$ ConnectionStrings:CocShopDatabaseConnectionString %>" 
    SelectCommand="SELECT [ProductID], [Model] FROM [Product]">
</asp:SqlDataSource>

